/*
 * Copyright (c) 2024 Huawei Technologies Co.,Ltd.
 *
 * openGauss is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *
 * http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 * ---------------------------------------------------------------------------------------
 *
 * imcs_minmax_func.h
 * routines to support ColStore
 *
 *
 * IDENTIFICATION
 * src/include/access/imcs/imcs_minmax_func.h
 *
 * ---------------------------------------------------------------------------------------
 */

#ifndef IMCS_MINMAX_FUNC_H
#define IMCS_MINMAX_FUNC_H

#include "postgres.h"
#include "knl/knl_variable.h"
#include "imcu.h"

typedef void (*ImcsFuncSetMinMax)(Datum v, IMCUDesc *cuDescPtr, bool *);
typedef void (*ImcsCompareDatum)(char *minval, char *maxval, Datum v, bool *first, int *varstr_maxlen);
typedef void (*ImcsFinishCompareDatum)(const char *minval, const char *maxval, IMCUDesc *cuDescPtr);

extern ImcsFuncSetMinMax ImcsGetMinMaxFunc(Oid type_oid);

extern ImcsCompareDatum ImcsGetCompareDatumFunc(Oid type_oid);
extern ImcsFinishCompareDatum ImcsGetFinishCompareDatum(Oid type_oid);
extern bool ImcsIsCompareDatumDummyFunc(ImcsCompareDatum f);

#endif /* IMCS_MINMAX_FUNC_H */
